Skip to content

fix(repo): surface unrelated histories on Sync Fork - #39258

Merged
silverwind merged 2 commits into
go-gitea:mainfrom
r3wretrhy:fix/sync-fork-unrelated-histories
Sep 17, 2026
Merged

silverwind merged 2 commits into
go-gitea:mainfrom
r3wretrhy:fix/sync-fork-unrelated-histories

Conversation

@r3wretrhy

Copy link
Copy Markdown
Contributor

Sync Fork already maps merge conflicts to a JSON error. Unrelated histories still went through ServerError, so the UI showed a 500 HTML snippet instead of the same user-facing message PR merge already uses (repo.pulls.unrelated_histories).

The API path returned 500 for the same git error; PR merge returns 409. Match that.

Fixes #36772

AI assistance was used to locate the handler gap and draft the mapping. I reviewed and take responsibility for the change.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 7, 2026
@github-actions github-actions Bot added topic/repo Related to repositories type/bug labels Sep 7, 2026
@r3wretrhy
r3wretrhy force-pushed the fix/sync-fork-unrelated-histories branch from 4d4d598 to e2853e0 Compare September 7, 2026 12:06
Sync Fork mapped merge conflicts to a JSON error but left
unrelated-histories as ServerError, so the UI showed a 500 HTML
snippet. PR merge already maps this. Do the same on the web
handler and return 409 from the API.

Fixes go-gitea#36772

Assisted-by: Grok:grok-4
Signed-off-by: Zhaoqi Xu <lzy00419@outlook.com>
@r3wretrhy
r3wretrhy force-pushed the fix/sync-fork-unrelated-histories branch from e2853e0 to c45884f Compare September 7, 2026 12:53
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 8, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 17, 2026
@silverwind
silverwind enabled auto-merge (squash) September 17, 2026 12:05
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 17, 2026
@silverwind
silverwind merged commit be7cde7 into go-gitea:main Sep 17, 2026
23 checks passed
@GiteaBot GiteaBot added this to the 28.0.0 milestone Sep 17, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 17, 2026
silverwind added a commit to silverwind/gitea that referenced this pull request Sep 17, 2026
* origin/main: (21 commits)
  fix(repo): surface unrelated histories on Sync Fork (go-gitea#39258)
  refactor: replace AWS SDK with a REST client for CodeCommit migration (go-gitea#39330)
  perf(frontend): enable vite module preload (go-gitea#39332)
  [skip ci] Updated translations via Crowdin
  fix: add default timeout and handle errors for HaveIBeenPwned API (go-gitea#39316)
  fix(user): unify email validation for registration and settings (go-gitea#39304)
  refactor: replace Azure Blob SDK with a REST client (go-gitea#39315)
  build(gogit): disable gogit builds for stable releases (go-gitea#39324)
  test(e2e): log out to switch users in pr-review test (go-gitea#39328)
  enhance: support `ETag` on streamed repository archives, support `If-None-Match: *` (go-gitea#39289)
  fix: match install page update checker setting with app.ini (go-gitea#39317)
  fix(actions): use gitea's clock for actions durations (go-gitea#39323)
  [skip ci] Updated translations via Crowdin
  enhance(notifications): mark current notification page as read (go-gitea#39294)
  fix(actions): never show negative running durations (go-gitea#39322)
  fix: classify git failures on stderr, restrict migration failure detail (go-gitea#39010)
  [skip ci] Updated translations via Crowdin
  chore: fix various problems (go-gitea#39298)
  fix: correct stdErr match in isErrBlameNotFoundOrNotEnoughLines (go-gitea#39309)
  chore(deps): update actionslib to v1.0.0 (go-gitea#39295)
  ...
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 18, 2026
* 'main' of https://github.com/go-gitea/gitea: (30 commits)
  [skip ci] Updated translations via Crowdin
  enhance: update mermaid to v12 (go-gitea#39331)
  docs: correct ALLOW_LOCALNETWORKS description in app.example.ini (go-gitea#39240)
  enhance: allow attribute-less MathML elements and complete the Core allowlist (go-gitea#39337)
  fix(repo): surface unrelated histories on Sync Fork (go-gitea#39258)
  refactor: replace AWS SDK with a REST client for CodeCommit migration (go-gitea#39330)
  perf(frontend): enable vite module preload (go-gitea#39332)
  [skip ci] Updated translations via Crowdin
  fix: add default timeout and handle errors for HaveIBeenPwned API (go-gitea#39316)
  fix(user): unify email validation for registration and settings (go-gitea#39304)
  refactor: replace Azure Blob SDK with a REST client (go-gitea#39315)
  build(gogit): disable gogit builds for stable releases (go-gitea#39324)
  test(e2e): log out to switch users in pr-review test (go-gitea#39328)
  enhance: support `ETag` on streamed repository archives, support `If-None-Match: *` (go-gitea#39289)
  fix: match install page update checker setting with app.ini (go-gitea#39317)
  fix(actions): use gitea's clock for actions durations (go-gitea#39323)
  [skip ci] Updated translations via Crowdin
  enhance(notifications): mark current notification page as read (go-gitea#39294)
  fix(actions): never show negative running durations (go-gitea#39322)
  fix: classify git failures on stderr, restrict migration failure detail (go-gitea#39010)
  ...
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 18, 2026
* main: (30 commits)
  [skip ci] Updated translations via Crowdin
  enhance: update mermaid to v12 (go-gitea#39331)
  docs: correct ALLOW_LOCALNETWORKS description in app.example.ini (go-gitea#39240)
  enhance: allow attribute-less MathML elements and complete the Core allowlist (go-gitea#39337)
  fix(repo): surface unrelated histories on Sync Fork (go-gitea#39258)
  refactor: replace AWS SDK with a REST client for CodeCommit migration (go-gitea#39330)
  perf(frontend): enable vite module preload (go-gitea#39332)
  [skip ci] Updated translations via Crowdin
  fix: add default timeout and handle errors for HaveIBeenPwned API (go-gitea#39316)
  fix(user): unify email validation for registration and settings (go-gitea#39304)
  refactor: replace Azure Blob SDK with a REST client (go-gitea#39315)
  build(gogit): disable gogit builds for stable releases (go-gitea#39324)
  test(e2e): log out to switch users in pr-review test (go-gitea#39328)
  enhance: support `ETag` on streamed repository archives, support `If-None-Match: *` (go-gitea#39289)
  fix: match install page update checker setting with app.ini (go-gitea#39317)
  fix(actions): use gitea's clock for actions durations (go-gitea#39323)
  [skip ci] Updated translations via Crowdin
  enhance(notifications): mark current notification page as read (go-gitea#39294)
  fix(actions): never show negative running durations (go-gitea#39322)
  fix: classify git failures on stderr, restrict migration failure detail (go-gitea#39010)
  ...

# Conflicts:
#	pnpm-lock.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/repo Related to repositories type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error 500 when git rebase fails on Sync Fork button

4 participants